/*
Copyright (c) 2009, Young Digital Planet SA
All rights reserved.

* Redistribution and use in source and binary forms, with or without 
  modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this 
  list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, 
  this list of conditions and the following disclaimer in the documentation 
  and/or other materials provided with the distribution.
* Neither the name of the Young Digital Planet SA nor the names of its 
  contributors may be used to endorse or promote products derived from this 
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
*/
package com.yauthor.module.services
{
	import flash.display.DisplayObject;
	/**
	 * 
	 * Interface for AttentionPointer service. 
	 * 'IAttentionPointer' service loads, renders and manages behavior of a pointer object, which
	 * focuses user attention on a related module.
	 * To add Attention Pointer support to a module, instance of this class must be acuired (via module context)
	 * and started. Pointer behavior can be customized by parameterizing the 'start()' metod.
	 *  
	 * Pointer is drawn only if 'attentionPointerClip' style property is set, 
	 * otherwise service does nothing ( even if 'started' ).
	 
	 * @see com.yauthor.module.IModule2
	 * @see com.yauthor.module.IModuleContext
	 * 
	 * @example Adding attention pointer support to module. 

	<listing version="3.0">
		var pointer:IAttentionPointer = IModuleContext( context ).getService( IAttentionPointer );
		pointer.start(); 
	</listing>
	 * 
	 */ 
	public interface IAttentionPointer {
		
		/**
		 * Starts service.
		 * @param pointAt Object to point at. If 'null' service will point to related module itself. 
		 * @param clearOn List of DisplayObjects which will hide pointer on 'mouseover'. If 'null' service will point to related module itself. 
		 * @param autoActivate If 'true', pointer and all elements become visible and active automatically. Otherwise 'activate()' method must be called manually.
		 */ 
		function start ( pointAt:DisplayObject = null, 
					 clearOn:Array = null, 
					 autoActivate:Boolean = true ):void;
		
		/**
		 * Activates service.
		 * Required only if 'autoActivate' was set to false while invoking 'start'.
		 */			 
		function activate ():void;
		
		/**
		 * Stops service.
		 * When module is being removed, IAttentionPointer service must be stoped 
		 * manualy by calling 'stop()' method. Otherwise garbage collector will not be 
		 * able to free the related module memory.
		 * 'stop' method removes all liseners that are added by service and stops all sounds 
		 * in attention pointer content. 
		 */	
		function stop ():void;

		/**
		 * Allows to refresh pointer position manually. 
		 * In most cases usage of this method will not be necessary. 
		 * Note that pointer positioning depends on reciving FlexEvent.UPDATE_COMPLETE event. 
		 * If from some reason service will not be able to receive this event, the  
		 * pointer position will not adjust during changes in module layout. 
		 * This may occur when UPDATE_COMPLETE event it's not propagated or when module is a non-Flex swf )
		 */	
		function updatePointerPosition ():void;
	}
	
	
}